package com.mutual.reins.danger.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mutual.reins.danger.entity.*;
import com.mutual.reins.danger.service.*;
import com.mutual.reins.interf.entity.ReinsPolicyUnit;
import com.mutual.reins.utils.constraint.ReinsConst;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

/**
 * 实现投保单审核通过后 再保生成保单的危险单位接口
 *
 * @author panchen
 * @since 2021-04-26
 */
@Service
@Transactional(rollbackFor = Exception.class)
@Slf4j
public class GeneratePrpcDangerDtoServiceImpl implements IGeneratePrpcDangerDtoService {

    @Autowired
    private IPrptDangerUnitService iPrptDangerUnitService;
    @Autowired
    private IPrptDangerItemService iPrptDangerItemService;
    @Autowired
    private IPrptDangerPlanService iPrptDangerPlanService;
    @Autowired
    private IPrptDangerTotService iPrptDangerTotService;
    @Autowired
    private IPrptDangerCoinsService iPrptDangerCoinsService;
    @Autowired
    private IPrpcDangerDtoService iPrpcDangerDtoService;
    /**
     * 投保单转保单危险单位进行再保处理
     *
     * @param reinsPolicyUnitMap 接口表Map
     * @param ifOffLineCal 是否离线计算
     * @return 保单危险单位
     */
    @Override
    public PrpcDangerDto prptDangerDtoToPrpcDangerDto(Map<String, ReinsPolicyUnit> reinsPolicyUnitMap,boolean ifOffLineCal) {
        PrpcDangerDto prpcDangerDto = new PrpcDangerDto();
        List<String> keyList = new ArrayList<>(reinsPolicyUnitMap.keySet());
        QueryWrapper queryWrapper  = new QueryWrapper<>();
        queryWrapper.in("PROPOSALNO",keyList);
        //查询投保单危险单位数据
        Map<String,PrptDangerUnit> prptDangerUnitMap = iPrptDangerUnitService.selectPrptDangerUnitMap(queryWrapper);
        Map<String,List<PrptDangerItem>> prptDangerItemMap = iPrptDangerItemService.selectPrptDangerItemMap(queryWrapper);
        Map<String,List<PrptDangerPlan>> prptDangerPlanMap = iPrptDangerPlanService.selectPrptDangerPlanMap(queryWrapper);
        Map<String,List<PrptDangerTot>> prptDangerTotMap = iPrptDangerTotService.selectPrptDangerTotMap(queryWrapper);
        Map<String,List<PrptDangerCoins>> prptDangerCoinsMap = iPrptDangerCoinsService.selectPrptDangerCoinsMap(queryWrapper);
        //将投保单数据复制保单危险单位
        prptDangerUnitToPrpcDangerUnit(prpcDangerDto, prptDangerUnitMap, reinsPolicyUnitMap,ifOffLineCal);
        prptDangerItemToPrpcDangerItem(prpcDangerDto, prptDangerItemMap, reinsPolicyUnitMap);
        prptDangerPlanToPrpcDangerPlan(prpcDangerDto, prptDangerPlanMap, reinsPolicyUnitMap);
        prptDangerTotToPrpcDangerTot(prpcDangerDto,prptDangerTotMap,reinsPolicyUnitMap);
        prptDangerCoinsToPrpcDangerCoins(prpcDangerDto,prptDangerCoinsMap,reinsPolicyUnitMap);

        iPrpcDangerDtoService.savePrpcDangerDtoList(prpcDangerDto);
        prpcDangerDto.setReinsPolicyUnitMap(reinsPolicyUnitMap);
        return prpcDangerDto;
    }

    /**
     * 投保单转保单（Coins）
     * @param prpcDangerDto 保单危险单位
     * @param prptDangerCoinsMap 投保单危险单位PlanMap
     * @param reinsPolicyUnitMap 接口表Map
     */
    private void prptDangerCoinsToPrpcDangerCoins(PrpcDangerDto prpcDangerDto, Map<String, List<PrptDangerCoins>> prptDangerCoinsMap, Map<String, ReinsPolicyUnit> reinsPolicyUnitMap) {
        HashMap<String,List<PrpcDangerCoins>> prpcDangerCoinsMap = new HashMap<>(16);
        List<PrpcDangerCoins>  prpcDangerCoinsList = new ArrayList<>();
        for(Map.Entry<String, List<PrptDangerCoins>> entry: prptDangerCoinsMap.entrySet()){
            List<PrptDangerCoins> prptDangerCoinsList = entry.getValue();
            for (PrptDangerCoins prptDangerCoins : prptDangerCoinsList){
                PrpcDangerCoins prpcDangerCoins= new PrpcDangerCoins();
                ReinsPolicyUnit reinsPolicyUnit = reinsPolicyUnitMap.get(prptDangerCoins.getProposalNo());
                prpcDangerCoins.setPolicyNo(reinsPolicyUnit.getPolicyNo());
                prpcDangerCoins.setDangerNo(prptDangerCoins.getDangerNo());
                prpcDangerCoins.setMainPolicyNo(reinsPolicyUnit.getPolicyNo());
                prpcDangerCoins.setSerialNo(prptDangerCoins.getSerialNo());
                prpcDangerCoins.setCoinsCode(prptDangerCoins.getCoinsCode());
                prpcDangerCoins.setCoinsName(prptDangerCoins.getCoinsName());
                prpcDangerCoins.setCoinsType(prptDangerCoins.getCoinsType());
                prpcDangerCoins.setCoinsRate(prptDangerCoins.getCoinsRate());
                prpcDangerCoins.setChiefFlag(prptDangerCoins.getChiefFlag());
                prpcDangerCoins.setProportionFlag(prptDangerCoins.getProportionFlag());
                prpcDangerCoins.setCurrency(prptDangerCoins.getCurrency());
                prpcDangerCoins.setCoinsAmount(prptDangerCoins.getCoinsAmount());
                prpcDangerCoins.setCoinsPremium(prptDangerCoins.getCoinsPremium());
                prpcDangerCoins.setMiddleCostFee(prptDangerCoins.getMiddleCostFee());
                prpcDangerCoins.setFlag("");

                prpcDangerCoins.setVat(prptDangerCoins.getVat());
                prpcDangerCoins.setPremOfVat(prptDangerCoins.getPremOfVat());
                prpcDangerCoins.setFreeVat(prptDangerCoins.getFreeVat());
                prpcDangerCoins.setPremFreeVat(prptDangerCoins.getPremFreeVat());
                //增加考核机构，考核人员
                prpcDangerCoins.setExamineComCode(prptDangerCoins.getExamineComCode());
                prpcDangerCoins.setExamineUserCode(prptDangerCoins.getExamineUserCode());
                if(prpcDangerCoinsMap.containsKey(prpcDangerCoins.getPolicyNo()+"-"+prpcDangerCoins.getDangerNo())){
                    List<PrpcDangerCoins> prpcDangerCoinsListMap = prpcDangerCoinsMap.get(prpcDangerCoins.getPolicyNo()+"-"+prpcDangerCoins.getDangerNo());
                    prpcDangerCoinsListMap.add(prpcDangerCoins);
                }else{
                    List<PrpcDangerCoins> prpcDangerCoinsListMap = new ArrayList<>();
                    prpcDangerCoinsListMap.add(prpcDangerCoins);
                    prpcDangerCoinsMap.put(prpcDangerCoins.getPolicyNo()+"-"+prpcDangerCoins.getDangerNo(),prpcDangerCoinsListMap);
                }
                prpcDangerCoinsList.add(prpcDangerCoins);
            }
        }
        prpcDangerDto.setPrpcDangerCoinsMap(prpcDangerCoinsMap);
        prpcDangerDto.setPrpcDangerCoinsDtoList(prpcDangerCoinsList);
    }

    /**
     * 投保单转保单（Tot）
     * @param prpcDangerDto 保单危险单位
     * @param prptDangerTotMap 投保单危险单位PlanMap
     * @param reinsPolicyUnitMap 接口表Map
     */
    private void prptDangerTotToPrpcDangerTot(PrpcDangerDto prpcDangerDto, Map<String, List<PrptDangerTot>> prptDangerTotMap, Map<String, ReinsPolicyUnit> reinsPolicyUnitMap) {
        HashMap<String,List<PrpcDangerTot>> prpcDangerTotMap = new HashMap<>(16);
        List<PrpcDangerTot> prpcDangerTotList = new ArrayList<>();
        for(Map.Entry<String, List<PrptDangerTot>> entry: prptDangerTotMap.entrySet()){
            List<PrptDangerTot> prptDangerTotList = entry.getValue();
            for(PrptDangerTot prptDangerTot:prptDangerTotList){
                PrpcDangerTot prpcDangerTot = new PrpcDangerTot();
                ReinsPolicyUnit reinsPolicyUnit = reinsPolicyUnitMap.get(prptDangerTot.getProposalNo());
                prpcDangerTot.setPolicyNo(reinsPolicyUnit.getPolicyNo());
                prpcDangerTot.setDangerNo(prptDangerTot.getDangerNo());
                prpcDangerTot.setSCurrency(prptDangerTot.getSCurrency());
                prpcDangerTot.setAmount(prptDangerTot.getAmount());
                prpcDangerTot.setPremium(prptDangerTot.getPremium());
                prpcDangerTot.setTCurrency(prptDangerTot.getTCurrency());
                prpcDangerTot.setExchRate(prptDangerTot.getExchRate());
                prpcDangerTot.setAmountEx(prptDangerTot.getAmountEx());
                prpcDangerTot.setPremiumEx(prptDangerTot.getPremiumEx());
                prpcDangerTot.setFlag(prptDangerTot.getFlag());

                prpcDangerTot.setPremOfVat(prptDangerTot.getPremOfVat());
                prpcDangerTot.setVat(prptDangerTot.getVat());
                prpcDangerTot.setPremFreeVat(prptDangerTot.getPremFreeVat());
                prpcDangerTot.setFreeVat(prptDangerTot.getFreeVat());
                prpcDangerTot.setPremOfVatEx(prptDangerTot.getPremOfVatEx());
                prpcDangerTot.setVatEx(prptDangerTot.getVatEx());
                prpcDangerTot.setPremFreeVatEx(prptDangerTot.getPremFreeVatEx());
                prpcDangerTot.setFreeVatEx(prptDangerTot.getFreeVatEx());
                //增加考核机构，考核人员
                prpcDangerTot.setExamineComCode(prptDangerTot.getExamineComCode());
                prpcDangerTot.setExamineUserCode(prptDangerTot.getExamineUserCode());
                if(prpcDangerTotMap.containsKey(prpcDangerTot.getPolicyNo() + "-" + prpcDangerTot.getDangerNo())){
                    List<PrpcDangerTot> prpcDangerTotListMap = prpcDangerTotMap.get(prpcDangerTot.getPolicyNo() + "-" + prpcDangerTot.getDangerNo());
                    prpcDangerTotListMap.add(prpcDangerTot);
                }else{
                    List<PrpcDangerTot> prpcDangerTotListMap = new ArrayList<>();
                    prpcDangerTotListMap.add(prpcDangerTot);
                    prpcDangerTotMap.put(prpcDangerTot.getPolicyNo() + "-" + prpcDangerTot.getDangerNo(),prpcDangerTotListMap);
                }
                prpcDangerTotList.add(prpcDangerTot);
            }
        }
        prpcDangerDto.setPrpcDangerTotMap(prpcDangerTotMap);
        prpcDangerDto.setPrpcDangerTotDtoList(prpcDangerTotList);
    }

    /**
     * 投保单转保单（Plan）
     * @param prpcDangerDto 保单危险单位
     * @param prptDangerPlanMap 投保单危险单位PlanMap
     * @param reinsPolicyUnitMap 接口表Map
     */
    private void prptDangerPlanToPrpcDangerPlan(PrpcDangerDto prpcDangerDto, Map<String, List<PrptDangerPlan>> prptDangerPlanMap, Map<String, ReinsPolicyUnit> reinsPolicyUnitMap) {
        HashMap<String,List<PrpcDangerPlan>> prpcDangerPlanMap = new HashMap<>(16);
        List<PrpcDangerPlan> prpcDangerPlanList = new ArrayList<>();
        for(Map.Entry<String, List<PrptDangerPlan>> entry: prptDangerPlanMap.entrySet()){
            List<PrptDangerPlan> prptDangerPlanList = entry.getValue();
            for (PrptDangerPlan prptDangerPlan : prptDangerPlanList){
                PrpcDangerPlan prpcDangerPlan = new PrpcDangerPlan();
                ReinsPolicyUnit reinsPolicyUnit = reinsPolicyUnitMap.get(prptDangerPlan.getProposalNo());
                prpcDangerPlan.setPolicyNo(reinsPolicyUnit.getPolicyNo());
                prpcDangerPlan.setDangerNo(prptDangerPlan.getDangerNo());
                prpcDangerPlan.setSerialNo(prptDangerPlan.getSerialNo());
                prpcDangerPlan.setPayNo(prptDangerPlan.getPayNo());
                prpcDangerPlan.setPlanDate(prptDangerPlan.getPlanDate());
                prpcDangerPlan.setCurrency(prptDangerPlan.getCurrency());
                prpcDangerPlan.setPlanFee(prptDangerPlan.getPlanFee());
                prpcDangerPlan.setFlag(prptDangerPlan.getFlag());
                prpcDangerPlan.setVat(prptDangerPlan.getVat());
                prpcDangerPlan.setPremOfVat(prptDangerPlan.getPremOfVat());
                prpcDangerPlan.setFreeVat(prptDangerPlan.getFreeVat());
                prpcDangerPlan.setPremFreeVat(prptDangerPlan.getPremFreeVat());
                //增加考核机构，考核人员
                prpcDangerPlan.setExamineComCode(prptDangerPlan.getExamineComCode());
                prpcDangerPlan.setExamineUserCode(prptDangerPlan.getExamineUserCode());
                if(prpcDangerPlanMap.containsKey(prpcDangerPlan.getPolicyNo()+"-"+prpcDangerPlan.getDangerNo())){
                    List<PrpcDangerPlan> prpcDangerPlanListMap = prpcDangerPlanMap.get(prpcDangerPlan.getPolicyNo()+"-"+prpcDangerPlan.getDangerNo());
                    prpcDangerPlanListMap.add(prpcDangerPlan);
                }else{
                    List<PrpcDangerPlan> prpcDangerPlanListMap = new ArrayList<>();
                    prpcDangerPlanListMap.add(prpcDangerPlan);
                    prpcDangerPlanMap.put(prpcDangerPlan.getPolicyNo()+"-"+prpcDangerPlan.getDangerNo(),prpcDangerPlanListMap);
                }
                prpcDangerPlanList.add(prpcDangerPlan);
            }
        }
        prpcDangerDto.setPrpcDangerPlanMap(prpcDangerPlanMap);
        prpcDangerDto.setPrpcDangerPlanDtoList(prpcDangerPlanList);
    }

    /**
     * 投保单转保单（Item）
     * @param prpcDangerDto 保单危险单位
     * @param prptDangerItemMap 投保单危险单位ItemMap
     * @param reinsPolicyUnitMap 接口表Map
     */
    private void prptDangerItemToPrpcDangerItem(PrpcDangerDto prpcDangerDto, Map<String, List<PrptDangerItem>> prptDangerItemMap, Map<String, ReinsPolicyUnit> reinsPolicyUnitMap) {
        HashMap<String,List<PrpcDangerItem>> prpcDangerItemMap = new HashMap<>(16);
        List<PrpcDangerItem> prpcDangerItemList = new ArrayList<>();
        for(Map.Entry<String, List<PrptDangerItem>> entry: prptDangerItemMap.entrySet()){
            List<PrptDangerItem> prptDangerItemListMapEntry = entry.getValue();
            for (PrptDangerItem prptDangerItem : prptDangerItemListMapEntry){
                PrpcDangerItem prpcDangerItem = new PrpcDangerItem();
                ReinsPolicyUnit reinsPolicyUnit = reinsPolicyUnitMap.get(prptDangerItem.getProposalNo());
                prpcDangerItem.setPolicyNo(reinsPolicyUnit.getPolicyNo());
                prpcDangerItem.setRiskCode(prptDangerItem.getRiskCode());
                prpcDangerItem.setDangerNo(prptDangerItem.getDangerNo());
                prpcDangerItem.setSerialNo(prptDangerItem.getSerialNo());
                prpcDangerItem.setKindFlag(prptDangerItem.getKindFlag());
                prpcDangerItem.setKindName(prptDangerItem.getKindName());
                prpcDangerItem.setKindCode(prptDangerItem.getKindCode());
                prpcDangerItem.setItemCode(prptDangerItem.getItemCode());
                prpcDangerItem.setItemDetailName(prptDangerItem.getItemDetailName());
                prpcDangerItem.setPostcode(prptDangerItem.getPostCode());
                prpcDangerItem.setAddressCode(prptDangerItem.getAddressCode());
                prpcDangerItem.setAddressName(prptDangerItem.getAddressName());
                prpcDangerItem.setCurrency(prptDangerItem.getCurrency());
                prpcDangerItem.setAmount(prptDangerItem.getAmount());
                prpcDangerItem.setPremium(prptDangerItem.getPremium());
                prpcDangerItem.setCalculateFlag(prptDangerItem.getCalculateFlag());
                prpcDangerItem.setFlag(prptDangerItem.getFlag());
                prpcDangerItem.setProjectCode(prptDangerItem.getProjectCode());
                prpcDangerItem.setQuantity(prptDangerItem.getQuantity());
                prpcDangerItem.setPremOfVat(prptDangerItem.getPremOfVat());
                prpcDangerItem.setVat(prptDangerItem.getVat());
                prpcDangerItem.setPremFreeVat(prptDangerItem.getPremFreeVat());
                prpcDangerItem.setFreeVat(prptDangerItem.getFreeVat());
                //增加考核机构，考核人员
                prpcDangerItem.setExamineComCode(prptDangerItem.getExamineComCode());
                prpcDangerItem.setExamineUserCode(prptDangerItem.getExamineUserCode());
                if(prpcDangerItemMap.containsKey(prpcDangerItem.getPolicyNo()+"-"+prpcDangerItem.getDangerNo())){
                    List<PrpcDangerItem> prpcDangerItemListMap = prpcDangerItemMap.get(prpcDangerItem.getPolicyNo()+"-"+prpcDangerItem.getDangerNo());
                    prpcDangerItemListMap.add(prpcDangerItem);
                }else{
                    List<PrpcDangerItem> prpcDangerItemListMap = new ArrayList<>();
                    prpcDangerItemListMap.add(prpcDangerItem);
                    prpcDangerItemMap.put(prpcDangerItem.getPolicyNo()+"-"+prpcDangerItem.getDangerNo(), prpcDangerItemListMap);
                }
                prpcDangerItemList.add(prpcDangerItem);
            }
        }
        prpcDangerDto.setPrpcDangerItemMap(prpcDangerItemMap);
        prpcDangerDto.setPrpcDangerItemDtoList(prpcDangerItemList);
    }

    /**
     * 投保单转保单（Unit）
     * @param prpcDangerDto 保单危险单位
     * @param prptDangerUnitMap 投保单危险单位UnitMap
     * @param reinsPolicyUnitMap 接口表Map
     * @param ifOffLineCal 是否离线计算
     */
    private void prptDangerUnitToPrpcDangerUnit(PrpcDangerDto prpcDangerDto, Map<String, PrptDangerUnit> prptDangerUnitMap, Map<String, ReinsPolicyUnit> reinsPolicyUnitMap,boolean ifOffLineCal) {
        HashMap<String,PrpcDangerUnit> prpcDangerUnitMap = new HashMap<>(16);
        List<PrpcDangerUnit> prpcDangerUnitList = new ArrayList<>();
        for(Map.Entry<String, PrptDangerUnit> entry: prptDangerUnitMap.entrySet()){
            PrptDangerUnit prptDangerUnit = entry.getValue();
            PrpcDangerUnit  prpcDangerUnit= new PrpcDangerUnit();
            ReinsPolicyUnit reinsPolicyUnitDto=reinsPolicyUnitMap.get(prptDangerUnit.getProposalNo());
            prpcDangerUnit.setPolicyNo(reinsPolicyUnitDto.getPolicyNo());
            prpcDangerUnit.setRiskCode(prptDangerUnit.getRiskCode());
            prpcDangerUnit.setDangerNo(prptDangerUnit.getDangerNo());
            prpcDangerUnit.setDangerDesc(prptDangerUnit.getDangerDesc());
            prpcDangerUnit.setAddressCode(prptDangerUnit.getAddressCode());
            prpcDangerUnit.setAddressName(prptDangerUnit.getAddressName());
            prpcDangerUnit.setRiskLevel(prptDangerUnit.getRiskLevel());
            prpcDangerUnit.setRiskLevelDesc(prptDangerUnit.getRiskLevelDesc());
            prpcDangerUnit.setRiskClass(prptDangerUnit.getRiskClass());
            prpcDangerUnit.setRiskClassDesc(prptDangerUnit.getRiskClassDesc());
            prpcDangerUnit.setItemKind(prptDangerUnit.getItemKind());
            prpcDangerUnit.setItemKindDesc(prptDangerUnit.getItemKindDesc());
            prpcDangerUnit.setCurrency(prptDangerUnit.getCurrency());
            prpcDangerUnit.setAmount(prptDangerUnit.getAmount());
            prpcDangerUnit.setPremium(prptDangerUnit.getPremium());
            prpcDangerUnit.setDisFee(prptDangerUnit.getDisFee());
            prpcDangerUnit.setDangerShare(prptDangerUnit.getDangerShare());
            prpcDangerUnit.setRetCurrency(prptDangerUnit.getRetCurrency());
            prpcDangerUnit.setRetentionValue(prptDangerUnit.getRetentionValue());
            prpcDangerUnit.setSpeCurrency(prptDangerUnit.getSpeCurrency());
            prpcDangerUnit.setSpeRate(prptDangerUnit.getSpeRate());
            prpcDangerUnit.setSpeValue(prptDangerUnit.getSpeValue());
            prpcDangerUnit.setReMarks(prptDangerUnit.getReMarks());
            prpcDangerUnit.setFlag(prptDangerUnit.getFlag());
            prpcDangerUnit.setEndorseTimes(0);
            prpcDangerUnit.setGroupFlag(prptDangerUnit.getGroupFlag());
            prpcDangerUnit.setCoinsFlag(prptDangerUnit.getCoinsFlag());
            prpcDangerUnit.setShareholderFlag(prptDangerUnit.getShareholderFlag());
            prpcDangerUnit.setBusinessFlag(prptDangerUnit.getBusinessFlag());

            prpcDangerUnit.setShipCode(prptDangerUnit.getShipCode());
            prpcDangerUnit.setShipCname(prptDangerUnit.getShipCname());
            prpcDangerUnit.setBusiness(prptDangerUnit.getBusiness());
            prpcDangerUnit.setStartDate(prptDangerUnit.getStartDate());
            prpcDangerUnit.setEndDate(prptDangerUnit.getEndDate());
            prpcDangerUnit.setBusiness(prptDangerUnit.getBusiness());
            //增加业务渠道代码
            prpcDangerUnit.setBusinessChannel(prptDangerUnit.getBusinessChannel());
            prpcDangerUnit.setFlag1(prptDangerUnit.getFlag1());
            prpcDangerUnit.setBusinessNature(prptDangerUnit.getBusinessNature());
            //是否离线计算
            if (ifOffLineCal == true && !ReinsConst.COINSFLAG_CL.equals(prpcDangerUnit.getCoinsFlag()))
            {
                prpcDangerUnit.setReinsureFlag("2");
            }else{
                prpcDangerUnit.setReinsureFlag("0");
            }
            prpcDangerUnit.setPremOfVat(prptDangerUnit.getPremOfVat());
            prpcDangerUnit.setVat(prptDangerUnit.getVat());
            prpcDangerUnit.setVatRate(prptDangerUnit.getVatRate());
            prpcDangerUnit.setPremFreeVat(prptDangerUnit.getPremFreeVat());
            prpcDangerUnit.setFreeVat(prptDangerUnit.getFreeVat());
            //增加考核机构，考核人员
            prpcDangerUnit.setExamineComCode(prptDangerUnit.getExamineComCode());
            prpcDangerUnit.setExamineUserCode(prptDangerUnit.getExamineUserCode());
            prpcDangerUnitMap.put(prpcDangerUnit.getPolicyNo()+"-"+prpcDangerUnit.getDangerNo(), prpcDangerUnit);
            prpcDangerUnitList.add(prpcDangerUnit);
        }
        prpcDangerDto.setPrpcDangerUnitMap(prpcDangerUnitMap);
        prpcDangerDto.setPrpcDangerUnitDtoList(prpcDangerUnitList);
    }
}
